#ifndef __BODY_H_
#define __BODY_H_
#define StartStructStatement CreateBiaoHaoTable()
#define EndStructStatement DestroyBiaoHaoTable() 
#define NEWTEMP NewTemp+1
typedef enum Arg_Kind{arg_label,arg_int,arg_real,arg_chars,arg_char,arg_bool,arg_var,arg_fun,arg_pro}ARG_KIND;
struct LogicAddr 
{
  int Level;
  int Offset;
  AccessKIND Mode;
};
typedef union rout_attri
  {
	  struct {int Level;int Offset;} FormalRout;
	  struct {int EntryLabel;}ActualRout;
  } ROUT_ATTRI;
struct RoutInform 
{
  RoutCLASS RoutKind;
  ROUT_ATTRI *Rout_Attri;
};
typedef union argbody
{
    int LabelARG;
	int IntARG;
	float RealARG;
	char CharsARG[255];
	char ChARG;
    int BoolARG;
	struct LogicAddr VarARG;
	struct RoutInform FuncARG;
	struct RoutInform ProcARG;
}ARGbody;
typedef struct arg
{ 
  int id;
  int DL;
  ARG_KIND ArgKind;
  ARGbody *ArgBody;
}ARG;
typedef struct semstack
{
 TYPEIR *type;
 ARG *arg;
}SEMSTACK;
typedef struct labelstack
{
 ARG *ElseL;
 ARG *OutL;
}LABELSTACK;
typedef struct midcode
{
  int op;
  ARG *first_arg;
  ARG *second_arg;
  ARG *result_arg;
}MIDCODE;
typedef enum{VarKind,ValKind,ValueKind}ACTKIND;
LABELSTACK LS[Y_Max];
MIDCODE MidCode[Y_Max];
SEMSTACK SemStack[Y_Max];
ARG *BreakStack[Y_Max],*ContinueStack[Y_Max],*SizeStack[Y_Max];
int SemStack_flag,MidCode_flag,NewTemp,Ls_flag,Break_flag,Continue_flag,Size_flag,Break,Continue,Jump[Y_Max],Jump_flag,EnLabel[Y_Max];
void InitArg(ARG **arg ,ARG_KIND ArgKind,ARGbody *ArgBody);
void SendCode(int op,ARG *first_arg,ARG *second_arg,ARG *result_arg);
ACTKIND ActKind;
void Init_flag();
int Compat_ass(TYPEIR *VPtr,TYPEIR *EPtr);
void ExprProcess(TYPEIR **Etype);
void callStatement();
void Statement();
#endif